<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 *快递公司
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
$return=array();
$tabs=array(
	array('op'=>'list','title'=>'快递公司'),
);
//快递公司
if($_RQ['op']=='list'){
	$params=array();
	if(!empty($_RQ['title'])){
		$params['title like']='%'.trim($_RQ['title']).'%';
		$return['params']['title']=$_RQ['title'];
	}
	$pindex = max(1, intval($_RQ['page']));
	$psize = 10;
	$total='';
	$list=pdo_getslice('jy_qqdian_express',$params,array($pindex,$psize),$total,$fields,'','id desc');
	if($list){
		foreach($list as &$item){

		}
	}	
	$return['list']=$list;
	$totalpage=ceil($total/$psize);
	$totalpage=intval($totalpage);
	$return['totalpage'] =$totalpage;
	$return['params']['page'] =$pindex;
	$htmls=array(
		'type'=>'list',
		'tabs'=>$tabs,
		'list'=>array('data'=>'list','edit'=>false,'del_one'=>false,'delall'=>false,'list'=>array(
			array('name'=>'name','title'=>'标识','type'=>'string'),
			array('name'=>'title','title'=>'名称','type'=>'string'),
		),'batch'=>array(
			array('type'=>'post','url'=>'/express/updata/','title'=>'同步快递公司'),
		)),
		'search_one'=>array('name'=>'title','title'=>'快递名称','add'=>false),
	);
	$return['htmls']=$htmls;
	$status=array('0'=>'显示','1'=>'隐藏');
	$return['status']=$status;
	exi($return);
}
if($_RQ['op']=='updata'){
	$this->model('model')->upexpress();
	exi('同步成功！');
}